<?php
require_once('dao.php');

$lc = DAOFactory::getPA10DAO()->queryBySeg(0);
$sh = DAOFactory::getSubHeadingDAO()->load($lc[0]->que);
$des = DAOFactory::getDescriptionDAO()->load($lc[0]->ans);
$cforums = DAOFactory::getCONTACTDAO()->queryAll();
if($cforums):
    $cforum = $cforums[0];
    else:
        $cforum = new CONTACT();
endif;
?>
<?php include_once 'include/header.php'; ?>

<div class="main_wrapper">
    <div class="main_container">
        <div class="left_wrapper">
            <h2> <?php echo $sess->TVar($mh5->textEn, $mh5->textSv); ?> </h2>
            <h3> <?php echo $sess->TVar($sh->textEn, $sh->textSv); ?> </h3>
            <p>
<?php echo c_to_html($sess->TVar($des->textEn, $des->textSv)); ?>
            </p>

            <div class="contact_form">
                <form action="" method="post">
                    <h2><?php echo $sess->TVar($cforum->hEADINGEN,$cforum->hEADINGSV);?></h2>
                    <h3><?php echo $sess->TVar($cforum->nAMEEN,$cforum->nAMESV);?></h3>
                    <input type="text" name="name"/>

                    <h3><?php echo $sess->TVar($cforum->eMAILEN,$cforum->eMAILSV);?></h3>
                    <input type="text" name="email"/>

                    <h3><?php echo $sess->TVar($cforum->tEXTEN,$cforum->tEXTSV)?></h3>
                    <textarea name="message"></textarea>

                    <input type="submit" value="<?php echo $sess->TVar($cforum->bUTTONEN,$cforum->bUTTONSV); ?>" name="submit_forum"/>
                </form>   
            </div>
        </div>

        <div class="right_wrapper forum_wrapper">
            <table>

<?php
$pc = DAOFactory::getPA10DAO()->queryBySeg(1);
foreach ($pc as $key => $value):
    $que = DAOFactory::getSubHeadingDAO()->load($value->que);
    $ans = DAOFactory::getDescriptionDAO()->load($value->ans);
    $imgF = DAOFactory::getImageDAO()->load($value->imgQ);
    $imgS = DAOFactory::getImageDAO()->load($value->imgA);
    ?>


                    <tr>
                        <td>
                            <img class="fraga_svar_img" src="images/fraga.png" />
                            <p>
    <?php echo c_to_html($sess->TVar($que->textEn, $que->textSv)); ?>

                            </p>
    <?php
    if (!empty($imgF->name)):
        ?>
                                <img class="svar_img" src="<?php echo IMAGE_PATH . $imgF->name ?>" />
                                <?php
                            endif;
                            ?>
                        </td>
                        <td class="left">
                            <img class="fraga_svar_img" src="images/svar.png" />
                            <p>
    <?php echo c_to_html($sess->TVar($ans->textEn, $ans->textSv)); ?>

                            </p>
                                <?php
                                if (!empty($imgS->name)):
                                    ?>
                                <img class="svar_img" src="<?php echo IMAGE_PATH . $imgS->name ?>" />
                                <?php
                            endif;
                            ?>
                        </td>
                    </tr>
                            <?php
                        endforeach;
                        ?>	

            </table>

        </div>
    </div>
    <div id="main_shadow"></div>
</div>


<?php include_once 'include/footer.php'; ?>
		
